Skip to content

feat: structured compliance policy report in job summary#210

Open
shenxianpeng wants to merge 1 commit into
mainfrom
feature/policy-report
Open

feat: structured compliance policy report in job summary#210
shenxianpeng wants to merge 1 commit into
mainfrom
feature/policy-report

Conversation

@shenxianpeng
Copy link
Copy Markdown
Member

What

Replaces the bare pass/fail job summary with a structured Commit Check Policy Report that shows per-check results as a clean Markdown table.

Before (current)

# Commit-Check ❌
` `` (collapsed)
bad commit output here
` ``

After (this PR)

# Commit Check Policy Report

**Repository**: `owner/repo`
**Policy file**: `commit-check.toml`
**Trigger**: `pull_request`

| Check | Result |
|---|---|
| Commit message | ❌ Fail |
| Branch naming | ✅ Pass |

### ❌ Some checks failed

<details>
<summary>Details</summary>
...
</details>

Why

  • Screenshot-ready: clean table format users can screenshot for READMEs, PR comments, compliance docs
  • Per-check visibility: users immediately see which check failed instead of parsing raw logs
  • Compliance/ODS alignment: structured policy report with repository info, policy file, and per-check status
  • Zero breakage: run_commit_check() and add_pr_comments() are completely unchanged

How

  • Leverages commit-check --format json for reliable per-check pass/fail determination
  • On pass: shortcuts to all-pass results (no extra work)
  • On failure: runs lightweight per-check JSON lookups to identify which exact checks failed
  • Raw output preserved in a collapsible <details> section for diagnostics
  • New CheckResult dataclass, build_policy_report(), determine_check_results(), and build_pass_results() functions
  • 18 new tests (65 total, all passing)

Checklist

  • All existing tests pass (47 unchanged)
  • 18 new tests added for report functions
  • Black / codespell / mypy clean
  • result.txt and PR comment behavior unchanged
  • job-summary: false still skips as before

Replace the bare pass/fail job summary with a structured
'Commit Check Policy Report' that shows per-check results
as a Markdown table with pass/fail indicators.

The report leverages commit-check's --format json output
to determine per-check pass/fail status without changing
the existing validation flow or PR comment behavior.

Key changes:
- Add CheckResult dataclass and report-building functions
- On pass: shortcuts to all-pass results (no extra work)
- On failure: runs per-check JSON lookups to identify
  which exact checks failed
- Raw output preserved in a collapsible <details> section
- Backward compatible: run_commit_check() and
  add_pr_comments() are unchanged
@shenxianpeng shenxianpeng requested a review from a team as a code owner May 29, 2026 06:09
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Warning

Review limit reached

@shenxianpeng, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 36 minutes and 4 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8078cb46-a588-415f-9104-3c23589aeb29

📥 Commits

Reviewing files that changed from the base of the PR and between a294f54 and b15dfd7.

📒 Files selected for processing (2)
  • main.py
  • main_test.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/policy-report

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

Commit-Check ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant